﻿#pragma once

#include "MyTestTypes.h"
#include "dosestat_export.h"

namespace dosestat
{
    using mytesttypes::DoseStatRet;

    // 计算DVH（剂量体积直方图）
    DOSESTAT_EXPORT DoseStatRet Accumulate(const std::vector<double>& voxelVolume, const std::vector<double>& voxelDose, bool doExactAccumulation);

    // 计算ROI内的剂量统计指标
    DOSESTAT_EXPORT double GetDoseStatRoiInterp(const std::string& dose_type,
                                                const std::vector<double>& binnedDoseValues,
                                                const std::vector<double>& accumulatedRelativeVolumes,
                                                const std::vector<double>& voxelVolume,
                                                const std::vector<double>& voxelDose,
                                                double doseAtVolume = 0.0);

    // 辅助函数：获取特定体积百分比对应的剂量
    DOSESTAT_EXPORT double GetMetric(double doseAtVolume,
                                     const std::vector<double>& binnedDoseValues,
                                     const std::vector<double>& accumulatedRelativeVolumes);

}  // namespace dosestat
